package cn.zswltech.gruul.biz.service;

import cn.zswltech.gruul.biz.support.service.IService;
import cn.zswltech.gruul.common.result.Response;
import cn.zswltech.gruul.common.entity.DisplayGroupDO;
import cn.zswltech.gruul.common.entity.OrgDO;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface OrgService extends IService<OrgDO> {
    Response<Map> createOrg(OrgDO orgDO);

    Response updateOrg(OrgDO orgDO);

    Response deleteOrg(Long id);

    void deleteOrgMenuFunctions(Long orgId, Long menuId, String optType, Long functionId) throws Exception;

    /**
     * @param orgOnly 是否只返回机构
     * @param orgSelect 是否只返回用户所在机构
     * @return
     */
    Response<List<OrgDO>> getOrgList(Boolean orgOnly,Boolean orgSelect);

    Response<List<OrgDO>> getOrgList();

    /**
     * 刷新数据库中全量机构信息到redis缓存
     */
    void refreshOrgCache();

    Response<List<DisplayGroupDO>> getMenuFunctions(Long orgId);

    Response setMenuFunctions(Long orgId, String params);

    List<OrgDO> selectByIds(List<Long> deptIdList,int type);

    List<OrgDO> queryByParentIds(Collection<Long> parentIds);


    /**
     * 推送机构数据到redis
     */
    void pushOrg2Redis();
}
